<template>
    <div style="height: 100%; position: relative">
         <div>
            <el-tabs>
                <el-tab-pane
                    v-for="item in tabs"
                    :label="item.label"
                    :key="item.label"
                >
                </el-tab-pane>
            </el-tabs>
            <div class="table-list" style="width:100%;margin-top: 20px;">
                <el-table
                    :data="aList"
                    border
                    style="width: 100%"
                     :height="oHeight" 
                    ref="table"
                    :header-cell-style="{'text-align':'center'}"
                    :cell-style="{'text-align':'center'}"
                >
                    
                    <el-table-column
                        label="修改内容"
                        prop="title"
                        :show-overflow-tooltip="true"
                        width="220"
                    ></el-table-column>
                    <el-table-column
                        label="修改时间"
                        prop="create_time"
                        :show-overflow-tooltip="true"
                        width="200"
                    ></el-table-column>
                    <el-table-column
                        prop="content"
                        label="修改详情"
                        key="admin_login_time"
                        :show-overflow-tooltip="true"
                    ></el-table-column>
                    <el-table-column
                        prop="admin_name"
                        label="操作人"
                        key="admin_name"
                        :show-overflow-tooltip="true"
                        width="200"
                    ></el-table-column>
                
                </el-table>
                <!-- 分页器 -->
               <pagination
                :arr="aList"
                :total="total"
                :currentPage="currentPage"
                :handleSizeChange="handleSizeChange"
                :handleCurrentChange="handleCurrentChange"
            ></pagination>
            </div>
            </div>
        </div>
</template>
<script>
   import pagination from "@/components/pagination/pagination.vue";
   import { resize } from "@/common/js/height.js";
    export default {
        data() {
            return {
                tabs: [],
                aList: [],
                oHeight: 800,
                total: 1,
                currentPage: 1,
               searchObj: {
                //该变量定义查询传参
                pageSize: localStorage.getItem('eachNum') * 1 || 10,
                page: 1,
            },
            };
        },
        components:{
            pagination
        },
        created() {
            this.tabs = this.$route.meta.tabs;
            this.getList();
        },
        mounted() {
		resize(this)
	   },
        methods: {
            getList() {
                this.$http
                    .post(
                        "/admin/auth/index.php?act=operateLogs&op=list",
                        this.searchObj
                    )
                    .then(
                        res => {
                            if (res.code == 1) {
                                this.aList = res.data.list;
                                this.total = parseInt(res.data.totalCount);
                            } else {
                                this.$message.error("获取数据失败！");
                                this.aList = [];
                            }
                        },
                        err => {
                            this.$message.error("获取数据失败！");
                        }
                    );
            },
             //每页数据
        handleCurrentChange: function (val) {
            this.searchObj.page = val;
            this.currentPage = val;
            /*请求数据*/
            this.getList();
        },
        //分组一页多少数据
        handleSizeChange(val) {
            this.currentPage = 1;
            this.searchObj.page = 1;
            this.searchObj.pageSize = val;
            localStorage.setItem("eachNum", val)
            /*请求数据*/
            this.getList();
        },

        }
    };
</script>
<style lang="scss" scoped>
    /* .admin-control-add {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}
/deep/.el-drawer__body{
	overflow: auto;
	padding-bottom: 65px;
}
.demo-drawer__footer{
	position: absolute;
	bottom: 16px;
	left: 16px;
} */
</style>